export default ({ http }) => ({
  // 课程直接购买订单页面
  getCourseOrder(query, response, error) {
    return http.get(`/order/course/one`, query, response, error)
  },

  // 课程直接购买生成订单
  createCourseOrder(query, response, error) {
    return http.post(`/order/course/one`, query, response, error, false)
  },

  // 课时购买订单页面
  getOrderSection(query, response, error) {
    return http.get(`/order/section`, query, response, error)
  },

  // 课时购买订单页面
  createOrderSection(query, response, error) {
    return http.post('/order/section', query, response, error)
  },

  // 支付方式及个人余额
  getOrderPay(response, error) {
    return http.get(`/order/pay`, {}, response, error)
  },

  // 订单支付
  setOrderPay(query, response, error) {
    return http.post('/order/pay', query, response, error, false)
  },

  // 购物车购买订单页面
  getOrderCourseCart(query, response) {
    return http.get('/order/cart', query, response)
  },

  // 购物车购买生成订单
  createOrderCourseCart(query, response, error) {
    return http.post('/order/cart', query, response, error)
  },

  // 订单支付 - 第三方支付 - 订单支付状态查询
  payOrderquery(query, response) {
    return http.get('/pay/orderquery', query, response, {}, false)
  },

  // 公开考试订单渲染
  getOrderExamPaper(query, response) {
    return http.get('/order/exam/paper', query, response)
  },

  // 公开考试生成订单
  createOrderExamPaper(query, response, error) {
    return http.post('/order/exam/paper', query, response, error, false)
  },

  // 专项练习订单渲染
  getOrderExamSpecial(query, response) {
    return http.get('/order/exam/special', query, response)
  },

  // 专项练习生成订单
  createOrderExamSpecial(query, response, error) {
    return http.post('/order/exam/special', query, response, error, false)
  },

  // 套卷订单渲染
  getOrderExamRollup(query, response) {
    return http.get('/order/exam/rollup', query, response)
  },

  // 套卷生成订单
  createOrderExamRollup(query, response, error) {
    return http.post('/order/exam/rollup', query, response, error, false)
  },

  // 课程切换卡券更新积分选择
  getOrderCourseCredit(query, response) {
    return http.get('/order/course/credit', query, response, {}, false)
  },
  // 购物车切换卡券更新积分选择
  getOrderCartCredit(query, response, error) {
    return http.get('/order/cart/credit', query, response, error, false)
  }
})
